package com.karst.webnotes.chapter03
{
	import flash.events.Event;
	
	import org.aswing.AsWingManager;
	import org.papervision3d.core.proto.MaterialObject3D;
	import org.papervision3d.objects.primitives.PaperPlane;
	import org.papervision3d.view.BasicView;
	
	internal class PaperPlaneExample extends BasicView
	{
		public function PaperPlaneExample()
		{
			super() ;
			createView() ;
			startRendering() ;
		}
		
		private var materials : MaterialObject3D = null ;
		private var paperPlane : PaperPlane  = null ; // 平面
		private function createView() : void
		{
			if( materials == null )
			{
				materials = new MaterialObject3D() ;  //声明并创建列表材质
				materials.fillColor = 0x00FFFF ;
			}
			
			if( paperPlane == null )
				paperPlane = new PaperPlane( null, 3 ) ;

			scene.addChild( paperPlane ) ;
		}
		
		override protected function onRenderTick( event : Event = null ) : void
		{
			super.onRenderTick() ;
			if( paperPlane )
			{
				paperPlane.localRotationY-- ;
			}
		}
	}
}